<?php $this->load->view('_header') ?>
<script language="javascript" type="text/javascript" src="<?php echo site_url('js/formValidator_min.js')?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo site_url('js/formValidatorRegex.js')?>"></script>
<div class="Main">
	<div id="flightleft" style="width:495px">
		<div style="width:473px" class="homeadv"><?php echo $loginadv ?></div><!--广告消息-->
	</div>
	<div class="float_Right" style="width:469px;padding-right:10px">
		<?php
		echo form_open("user/dologin",array("id" => "formlogin"));
		echo form_hidden("returnurl",$returnurl);
		?>
		<table style="border:3px solid #CCC" width="438" height=238 border=0 >
			<tr height=60>
				<td align=right style="padding-right:22px" ><img src="<?php echo site_url('images/A5.gif')?>" /></td>
				<td class="logtitle"><?=lang("r_MemberSignIn")?></td>
			</tr>
			<tr height=40>
				<td width=125 align="right"><?=lang("r_Username")?>:</td>
				<td><?php
				$data = array(
						   'id'		   => 'tbxLoginNickname',
				              'name'        => 'useraccount',
				              'class'       => 'txd',
				            );
				
				echo form_input($data);	
				?></td>
				<td><div id="tbxLoginNicknameTip"></div></td>
			</tr>
			<tr height=40>
				<td align="right"><?=lang("r_Password")?>:&nbsp;&nbsp;</td>
				<td><?php
				$data = array(
						    'id'		   => 'tbxLoginPassword',
				              'name'        => 'userpassword',
				              'class'       => 'txd',
				            );
				
				echo form_password($data);	
				?></td>
				<td><div id="tbxLoginPasswordTip"></div></td>
			</tr>
			
			<tr height=40>
				<td align="right"><?=lang("r_CheckCode")?>:&nbsp;&nbsp;</td>
				<td><?php
				$data = array(
						    'id'		   => 'tbxLoginVerifier',
				              'name'        => 'tbxLoginVerifier',
				              'class'       => 'txd',
				            );
				
				echo form_input($data);	
				?></td>
				<td><div id="tbxLoginVerifierTip"></div></td>
			</tr>
			<tr height=40>
				<td></td>
				<td><img src="<?php echo site_url('user/yzm_img1')?>" id="ivrLoginVerifier" onclick="change_yzm1(this)">
				<div class="onError" style="overflow: hidden;">
				    <span id="cvlLoginVerifier" style="color: Red; display: none; float: left; margin-right: 5px;">验证码错误</span>
				    <em id="loginVerifier" style="padding-left: 0pt; float: left; display: none;"></em>
				</div>	
				</td>
			</tr>
			<tr height=20><td colspan=2 align=center ></td></tr>
			<tr height=78 valign=top >
				<td colspan=3 align=center >
					<input type=submit name="bbb" style="width:107px" value="<?=lang('sign_in')?>" class="btn3" />
					<?=lang('New_here')?>?|
		   			<a href="<?php echo site_url('user/register')?>"><?=lang('register')?></a>
				</td>
			</tr>
		</table>
		<?php
		echo form_close();
		?>
	</div>
	<script language="javascript">
	var msg = '<?php echo $error_msg; ?>';
	$(document).ready(function() {
		if (msg != 0){
			switch (msg){
				case 'verifier' : $('#cvlRegister').empty().text('<?=lang("rc_checkerr")?>').show();break;
				case 'verifier1' : $('#cvlLoginVerifier').show();break;
				case 'customer' : $('#cvlLoginUser').show();break;
				default : break;
			}
		}
		
		$.formValidator.initConfig({formid:"formlogin",onerror:function(msg){alert(msg)}});
		$("#tbxLoginNickname").formValidator({onshow:"<?=lang("rc_username")?>",onfocus:"",oncorrect:""}).inputValidator({min:1,max:100,onerror:"<?=lang("rc_username")?>"});
			
		$("#tbxLoginPassword").formValidator({onshow:"<?=lang("rc_userpassword")?>",onfocus:"",oncorrect:""}).inputValidator({min:1,max:100,onerror:"<?=lang("rc_userpassword")?>"});
		
		$("#tbxLoginVerifier").formValidator({onshow:"<?=lang("rc_checkcode")?>",onfocus:"",oncorrect:""}).inputValidator({min:1,max:100,onerror:"<?=lang("rc_checkcode")?>"});
				
	});

		
				
	function change_yzm1(obj)
	{
	
	    $(obj).attr('src','<?php echo site_url('user/yzm_img1')?>'+'/'+Math.random());
	}
	
	</script>
</div>

<?php $this->load->view('_footer') ?>